import { sendRequest } from '@/http';

const baseUrl = '/admin/staff';

/* 查询员工列表 */
export const queryStaffList = (params: any) =>
  sendRequest({
    url: `${baseUrl}/queryStaffList`,
    method: 'get',
    params,
  });

/* 查看员工详情 */
export const queryStaffInfo = (staffid: string) =>
  sendRequest({
    url: `${baseUrl}/queryStaffInfo`,
    method: 'get',
    params: { staffid },
  });

/* 编辑员工 */
export const editStaff = (data: any) =>
  sendRequest({
    url: `${baseUrl}/editStaff`,
    method: 'post',
    data,
  });

/* 编辑员工 */
export const createStaff = (data: any) =>
  sendRequest({
    url: `${baseUrl}/createStaff`,
    method: 'post',
    data,
  });

/* 删除员工 */
export const deleteStaff = (staffid: string) =>
  sendRequest({
    url: `${baseUrl}/deleteStaff`,
    method: 'post',
    data: { staffid },
  });
